<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    //时间戳 1970年到现在的毫秒数
    //1. getTime()  需要实例化
    const date = new Date();
    console.log(date.getTime('2025-10-08 12:05:41'));

    //2.+new Date()
    console.log(+new Date());

    //3. Date.now()
    console.log(Date.now());

</script>

</html>